import CameraMoveScript from './CameraMoveScript';
import MultiTouchScript from './MultiTouchScript';
import CameraControllerScript from './CameraControllerScript';
export default class WtjScene extends Laya.Scene {

    constructor() { 
        super();
        //this.loadScene("main.scene");
        //添加3D场景
        //var scene = Laya.stage.addChild(new Laya.Scene3D());
		
        // // //添加照相机
        // var camera = (scene.addChild(new Laya.Camera(0, 0.1, 100)));
        // camera.transform.translate(new Laya.Vector3(0, 3, 3));
        // camera.transform.rotate(new Laya.Vector3(-30, 0, 0), true, false);
        // camera.clearColor = null;

       
        
        // //添加方向光
        // var directionLight = scene.addChild(new Laya.DirectionLight());
        // directionLight.color = new Laya.Vector3(0.6, 0.6, 0.6);
        // directionLight.transform.worldMatrix.setForward(new Laya.Vector3(1, -1, 0));
        
        //wtj场景
        Laya.Scene3D.load('LayaScene_wtj/Conventional/wtj.ls', Laya.Handler.create(null, function(scene) {
            Laya.stage.addChild(scene);
            //var camera = scene.getChildByName("Main Camera");
            
            //camera.addComponent(CameraMoveScript);
            var wtj=scene.getChildByName('wtj');
            // camera.transform.translate(new Laya.Vector3(0, 0.8, 1.5));
            // //旋转相机
            // camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false);
            //camera.transform.lookAt(camera.transform.position, wtj.transform.position);
            wtj.addComponent(CameraControllerScript);
           

            // Laya.AnimationClip.load("LayaScene_wtj/Conventional/Assets/models/wtj-Take 001.lani", Laya.Handler.create(null, function(aniClip) {
                
            //     var wtjAnimator=scene.getChildByName('wtj').getComponent(Laya.Animator);
               
            //     //创建动作状态
            //     var state1 = new Laya.AnimatorState();
            //     //动作名称
            //     state1.name = "zhuan";
            //     // //动作播放起始时间
            //     state1.clipStart = 0 / 90;
            //     //动作播放结束时间
            //     state1.clipEnd = 90 / 90;
            //     //设置动作
            //     state1.clip = aniClip;
            //     //设置动作循环
            //     state1.clip.islooping = true;
            //     //为动画组件添加一个动作状态
            //     wtjAnimator.addState(state1);
            //     //播放动作
            //     wtjAnimator.play("zhuan");
            // }));
        }));
        
    }
   
    onEnable() {
    }

    onDisable() {
    }
}